package com.bytz.modules.cms.reseller.controller;

import com.bytz.common.api.vo.Result;
import com.bytz.modules.cms.reseller.model.ResellerSalesModel;
import com.bytz.modules.cms.reseller.service.IResellerSalesService;
import com.bytz.modules.cms.reseller.util.ResellerSecurityUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api(tags = "销售")
@RequestMapping("/sales")
public class SalesController {

    @Autowired
    private IResellerSalesService resellerSalesService;

    @ApiOperation("获取经销商所有销售")
    @RequestMapping(value = "/sales", method = RequestMethod.GET)
    public Result<List<ResellerSalesModel>> salesList() {

        return Result.ok(resellerSalesService.getSalesByResellerId(ResellerSecurityUtils.getUserId()));
    }


}
